import React from "react";
import lazyLoad from "@/routers/utils/lazyLoad";
import { LayoutIndex } from "@/routers/constant";
import { RouteObject } from "@/routers/interface";

// echarts 模块
const formRouter: Array<RouteObject> = [
	{
		element: <LayoutIndex />,
		path: "/goods",
		permissions: ["goodsListPage", "proxySalesPage"],
		meta: {
			title: "商品管理",
			icon: "ShoppingCartOutlined",
			sort: 3,
		},
		children: [
			{
				path: "/goods/gools-list",
				element: lazyLoad(React.lazy(() => import("@/views/goods/goodsList/index"))),
				meta: {
					requiresAuth: true,
					icon: "ShoppingCartOutlined",
					title: "商品列表",
					key: "goodsListPage",
					keepAlive: true,
				}
			},
			{
				path: "/goods/waterChart",
				element: lazyLoad(React.lazy(() => import("@/views/echarts/waterChart/index"))),
				meta: {
					requiresAuth: true,
					icon: "ShoppingCartOutlined",
					title: "球形echarts",
					key: "goodsListPage",
				}
			},
			{
				path: "/goods/columnChart",
				element: lazyLoad(React.lazy(() => import("@/views/echarts/columnChart/index"))),
				meta: {
					requiresAuth: true,
					icon: "ShoppingCartOutlined",
					title: "代售列表",
					key: "proxySalesPage",
				}
			},
			{
				path: "/goods/lineChart",
				element: lazyLoad(React.lazy(() => import("@/views/echarts/lineChart/index"))),
				meta: {
					requiresAuth: true,
					icon: "ShoppingCartOutlined",
					title: "折线图",
					key: "proxySalesPage"
				}
			},
			{
				path: "/goods/pieChart",
				element: lazyLoad(React.lazy(() => import("@/views/echarts/pieChart/index"))),
				meta: {
					requiresAuth: true,
					icon: "ShoppingCartOutlined",
					title: "饼图",
					key: "proxySalesPage"
				}
			},
			{
				path: "/goods/radarChart",
				element: lazyLoad(React.lazy(() => import("@/views/echarts/radarChart/index"))),
				meta: {
					requiresAuth: true,
					icon: "ShoppingCartOutlined",
					title: "雷达图",
					key: "proxySalesPage"
				}
			},
			{
				path: "/goods/nestedChart",
				element: lazyLoad(React.lazy(() => import("@/views/echarts/nestedChart/index"))),
				meta: {
					requiresAuth: true,
					icon: "ShoppingCartOutlined",
					title: "嵌套环形图",
					key: "proxySalesPage"
				}
			},
		]
	}
];

export default formRouter;
